home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / sendmail / uwo-course / sendmail.txt < prev    next >
Encoding:
Text File  |  1992-03-24  |  62.0 KB  |  2,971 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                                SSeennddmmaaiill ---- CCaarree aanndd FFeeeeddiinngg
  16.  
  17.  
  18.  
  19.  
  20.                                         _L_a_s_t _E_d_i_t
  21.                                       _M_a_r_c_h _2_4_, _1_9_9_2
  22.  
  23.  
  24.  
  25.  
  26.                            Reg Quinton <reggers@julian.uwo.ca>
  27.                           Computing and Communications Services
  28.                             The University of Western Ontario
  29.                                  London, Ontario N6A 5B7
  30.                                           Canada
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.                11..  HHiissttoorryy//GGooaallss
  75.  
  76.  
  77.                Our goal is to make system administrators self sufficient --
  78.                CCS cannot administer _y_o_u_r mail system.  You  have  to  take
  79.                responsiblity (but we can help).
  80.  
  81.  
  82.                Sendmail released with BSD 4.2 circa 1983 by Eric Allman. My
  83.                first experiences with sendmail were in 1984 with BSD 4.2 on
  84.                a DEC/Vax 750 called ddeeeepptthhoott.
  85.  
  86.  
  87.                The original context:
  88.  
  89.  
  90.                 (1)   DARPA network projects -- TCP/IP, RFC821/822
  91.  
  92.  
  93.                 (2)   MILnet, ARPAnet, Berknet (peer to peer)
  94.  
  95.  
  96.                 (3)   UUCP, BITNET, Decnet ...
  97.  
  98.  
  99.                Current  version  is  5.64  available  by anonymous FTP from
  100.                uuuunneett..uuuu..nneett (but most systems come with  good  versions  --
  101.                5.61++).
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                11                                               UUWWOO//SSeennddmmaaiill
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.                A goal of sendmail is to provide a _f_l_e_x_i_b_l_e mail router for
  141.  
  142.  
  143.                 (1)   TCP/IP peer to peer
  144.  
  145.  
  146.                 (2)   Gateway between nets (_e_g_. UUCP to ARPAnet)
  147.  
  148.  
  149.                To be a gateway requires header and address rewriting (_m_u_n_g_-
  150.                _i_n_g). These days that's minimized since most mail is  deliv-
  151.                ered  from sender directly to recipient without having to go
  152.                through any relays.
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                UUWWOO//SSeennddmmaaiill                                               22
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.                Sendmail is a _c_o_n_f_i_g_u_r_a_b_l_e system. Predated  by  delivermail
  207.                (of BSD 4.1) which required edit/recompile to reconfigure.
  208.  
  209.  
  210.                //uussrr//lliibb//sseennddmmaaiill
  211.                     -- the executable image.
  212.  
  213.  
  214.                //uussrr//lliibb//sseennddmmaaiill..ccff
  215.                     -- the configuration file.
  216.  
  217.  
  218.                Early  distributions  had ugly configuration files (but then
  219.                life was complicated back then).
  220.  
  221.  
  222.                There is a reputation that you have to be a _g_u_r_u to maintain
  223.                sendmail -- this is simply not true!
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                33                                               UUWWOO//SSeennddmmaaiill
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.                Alternatives to sendmail?  (The usual gripe is "I can't fig-
  273.                ure out sendmail.cf").  In my  humble  opinion  alternatives
  274.                like MMDF, {X, Y, Z}mail, etc. should be aavvooiiddeedd.
  275.  
  276.  
  277.                Sendmail  is  a  mature product with few problems. Most Unix
  278.                sites on the Internet are using sendmail.
  279.  
  280.  
  281.                SSeennddmmaaiill iiss aallssoo tthhee pprroodduucctt CCCCSS ssuuppppoorrttss ---- cchhoooossee  aannootthheerr
  282.                aatt yyoouurr oowwnn rriisskk..
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                UUWWOO//SSeennddmmaaiill                                               44
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.                11..11..  WWhheerree??
  339.  
  340.                Instructions,  etc.  for  supporting  a  sendmail system are
  341.                available from jjuulliiaann..uuwwoo..ccaa in ~~ffttpp//nniicc//sseennddmmaaiill
  342.  
  343.                [[33::2277ppmm zzeebbrraa]] ffttpp jjuulliiaann..uuwwoo..ccaa
  344.                CCoonnnneecctteedd ttoo jjuulliiaann..uuwwoo..ccaa..
  345.                222200 jjuulliiaann..uuwwoo..ccaa FFTTPP sseerrvveerr ((VVeerrssiioonn 55..6655 ......
  346.                NNaammee ((jjuulliiaann..uuwwoo..ccaa::rreeggggeerrss)):: aannoonnyymmoouuss
  347.                333311 GGuueesstt llooggiinn ookk,, sseenndd iiddeenntt aass ppaasssswwoorrdd..
  348.                PPaasssswwoorrdd::
  349.                223300 GGuueesstt llooggiinn ookk,, aacccceessss rreessttrriiccttiioonnss aappppllyy..
  350.                ffttpp>> ccdd nniicc//sseennddmmaaiill
  351.                225500 CCWWDD ccoommmmaanndd ssuucccceessssffuull..
  352.                ffttpp>>
  353.  
  354.  
  355.                Alternatively ...
  356.  
  357.                [[33::2277ppmm jjuulliiaann]] ccdd ~~ffttpp//nniicc//sseennddmmaaiill
  358.                [[33::2288ppmm jjuulliiaann]] llss
  359.                CCoonnffiigguurree..sshh           RREEAADDMMEE..aalliiaasseess
  360.                RREEAADDMMEE                 aalliiaasseess..ddiissttrriibbuuttiioonn
  361.                sseennddmmaaiill..ddiissttrriibbuuttiioonn
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                55                                               UUWWOO//SSeennddmmaaiill
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.                22..  WWhhaatt iiss SSeennddmmaaiill??
  405.  
  406.  
  407.                22..11..  RReeaadd tthhee mmaannuuaall ppaaggee!!
  408.  
  409.  
  410.                Sendmail delivers/routes all mail  on  a  Unix  system.   It
  411.                accepts  a number of _a_r_g_u_m_e_n_t_s (_e_g_.  --bbdd means run as a dae-
  412.                mon) and messages are usually received/piped as _s_t_d_i_n.
  413.  
  414.                [[33::2288ppmm jjuulliiaann]] mmaann sseennddmmaaiill
  415.                SSEENNDDMMAAIILL((88))         EEPP//IIXX            SSEENNDDMMAAIILL((88))
  416.  
  417.                NNAAMMEE
  418.                     sseennddmmaaiill -- sseenndd mmaaiill oovveerr tthhee iinntteerrnneett
  419.  
  420.                SSYYNNOOPPSSIISS
  421.                     //uussrr//lliibb//sseennddmmaaiill [[ ffllaaggss ]] [[ aaddddrreessss ......  ]]
  422.  
  423.                     nneewwaalliiaasseess
  424.  
  425.                     mmaaiillqq [[ --vv ]]
  426.  
  427.                DDEESSCCRRIIPPTTIIOONN
  428.                     sseennddmmaaiill sseennddss aa mmeessssaaggee ttoo ......
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                UUWWOO//SSeennddmmaaiill                                               66
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.                22..22..  SSeennddmmaaiill iiss aa pprroocceessss
  471.  
  472.  
  473.                On jjuulliiaann..uuwwoo..ccaa we process about 1,000 -- 2,000 E-mail mes-
  474.                sages a day -- all are handle by sendmail.
  475.  
  476.  
  477.                When  you say, _e_g_. "mmaaiill rreeggggeerrss", your message is piped (as
  478.                stdin) to an instance of sendmail with rreeggggeerrss as  an  argu-
  479.                ment (standard fork/exec/argv and pipe notions).
  480.  
  481.  
  482.                If  you look at processes you may catch an instance of send-
  483.                mail delivering someone's mail.
  484.  
  485.                [[33::3300ppmm jjuulliiaann]] ppss --aaggxx || ggrreepp sseennddmmaaiill
  486.                 331100  ?? IIWW  00::4455 //uussrr//lliibb//sseennddmmaaiill --bbdd --qq1155mm
  487.                33116611 qq55 SSWWNN 00::0000 //uussrr//lliibb//sseennddmmaaiill --eemm --ooii rreeggggeerrss
  488.  
  489.  
  490.                You should always see at least one instance of  sendmail  --
  491.                the  sendmail  daemon  (this process is started at boot time
  492.                and persists like most daemons).
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                77                                               UUWWOO//SSeennddmmaaiill
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.                The instance with arguments `--bbdd --qq1155mm' is  a  daemon  (--bbdd)
  537.                that is retrying the queue every 15min (--qq1155mm).
  538.  
  539.  
  540.                You  can  tell  it's  a daemon because it has no controlling
  541.                terminal and it has a low process  number  (because  it  was
  542.                started early).
  543.  
  544.                 331100  ?? IIWW  00::4455 //uussrr//lliibb//sseennddmmaaiill --bbdd --qq1155mm
  545.  
  546.                The  instance  with  arguments  `--eemm  --ooii  rreeggggeerrss' has been
  547.                fork/exec'd from a program like "mmaaiill" -- delivering mail to
  548.                `rreeggggeerrss':
  549.  
  550.                33116611 qq55 SSWWNN 00::0000 //uussrr//lliibb//sseennddmmaaiill --eemm --ooii rreeggggeerrss
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                UUWWOO//SSeennddmmaaiill                                               88
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.                22..33..  SSeennddmmaaiill DDaaeemmoonn
  603.  
  604.  
  605.                Sendmail exists as a daemon process started at boot time.
  606.  
  607.  
  608.                 (1)   ppss --aaggxx || ggrreepp sseennddmmaaiill
  609.  
  610.  
  611.                 (2)   ggrreepp sseennddmmaaiill //eettcc//rrcc**
  612.  
  613.  
  614.                 (3)   nneettssttaatt --aa || ggrreepp ssmmttpp
  615.  
  616.  
  617.                 (4)   mmccoonnnneecctt jjuulliiaann..uuwwoo..ccaa
  618.  
  619.  
  620.                 (5)   tteellnneett jjuulliiaann..uuwwoo..ccaa 2255
  621.  
  622.  
  623.                Sendmail is the process that:
  624.  
  625.                     shows up in a process list,
  626.  
  627.                     is started out of your //eettcc//rrcc files,
  628.  
  629.                     is listening on the SMTP port,
  630.  
  631.                     you connect to with mmccoonnnneecctt,
  632.  
  633.                     alternatively with telnet to the SMTP port.
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.                99                                               UUWWOO//SSeennddmmaaiill
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.                The sendmail daemon has two principle jobs:
  669.  
  670.  
  671.                 (1)   listens to SMTP port for mail arriving via TCP/IP.
  672.  
  673.  
  674.                 (2)   processes     messages     spooled    (usually)    in
  675.                       //uussrr//ssppooooll//mmqquueeuuee
  676.  
  677.  
  678.                SMTP port assigned in //eettcc//sseerrvviicceess as  port  25  (that's  a
  679.                "Well Known Service" -- WKS records in DNS).
  680.  
  681.  
  682.                Protocol defined in RFC821  "Simple Mail Transfer Protocol",
  683.                Jon Postel, 1982.
  684.  
  685.  
  686.                SMTP server started by standard fork/exec sequence --  child
  687.                handles connection and parent listens for more.
  688.  
  689.  
  690.                The  peer  is  often  another  sendmail  processing its mail
  691.                queue.
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                UUWWOO//SSeennddmmaaiill                                              1100
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.                22..44..  SSeennddmmaaiill QQuueeuuee
  735.  
  736.  
  737.                Messages are queued for delivery in  a  spool  directory  --
  738.                usually //uussrr//ssppooooll//mmqquueeuuee
  739.  
  740.                [[1100::0088aamm jjuulliiaann]] mmaaiillqq
  741.                ...
  742.                AAAA0088779900 110011 TTuuee MMaarr 2244 0099::5544 <<VVIINNCCEE@@VVAAXXII..SSSSCCLL..UUWWOO..CCAA>>
  743.                            ((DDeeffeerrrreedd:: CCoonnnneeccttiioonn ttiimmeedd oouutt ......
  744.                            <<AASSSSHHUUSSCCRR@@CCMMSS..AAMM..CCCC..RREEAADDIINNGG..AACC..UUKK>>
  745.                AAAA0077333388 339966 TTuuee MMaarr 2244 0099::3388 <<33000022__440022@@uuwwoovvaaxx..uuwwoo..ccaa>>
  746.                            ((DDeeffeerrrreedd:: CCoonnnneeccttiioonn ttiimmeedd oouutt  ......
  747.                            <<rroossii@@ssgg11..cchheemm..nnrrcc..ccaa>>
  748.                AAAA2233004455  9955 MMoonn MMaarr 2233 1199::5500 <<mmaagguunnddii@@ggaauull..ccssdd..uuww ......
  749.                            ((DDeeffeerrrreedd:: CCoonnnneeccttiioonn ttiimmeedd oouutt ......
  750.                            <<rrccpp@@hhaarrddyy..hhddww..ccssdd..hhaarrrriiss..ccoomm>>
  751.                AAAA1100880044 774444 MMoonn MMaarr 2233 1166::5566 <<PPCCHHIIAARRAAMM@@nnoovveellll..bbuuss ......
  752.                            ((DDeeffeerrrreedd:: NNeettwwoorrkk iiss uunnrreeaacchhaabbllee))
  753.                            <<mmaarrccoo@@ccss..aatthhaabbaassccaauu..ccaa>>
  754.  
  755.  
  756.                Alternatively ....
  757.  
  758.                [[99::4499aamm jjuulliiaann]] llss //uussrr//ssppooooll//mmqquueeuuee
  759.                ddffAAAA0000001144  ddffAAAA1100880044  ddffAAAA2277666611  qqffAAAA0000002222  qqffAAAA2200994499
  760.                ddffAAAA0000002222  ddffAAAA1188888822  ddffAAAA2277995544  qqffAAAA0077118800  qqffAAAA2233004455
  761.                ddffAAAA0077118800  ddffAAAA2200994499  ddffAABB1155996677  qqffAAAA0077333388  qqffAAAA2277666611
  762.                ddffAAAA0077333388  ddffAAAA2233004455  qqffAAAA0000001144  qqffAAAA1100880044  qqffAAAA2277995544
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                1111                                              UUWWOO//SSeennddmmaaiill
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.                33..  SSeennddmmaaiill ffiilleess
  801.  
  802.  
  803.                //uussrr//lliibb//sseennddmmaaiill
  804.                     --  the  executable.  Sendmail must be found here since
  805.                     programs like MMaaiill, MMHH, UUUUCCPP, etc. pipe into this  pro-
  806.                     gram by fork/exec.
  807.  
  808.  
  809.                //uussrr//lliibb//sseennddmmaaiill..ccff
  810.                     --  the configuration file. Sendmail looks for the con-
  811.                     figuration file here (on SunOS also  //eettcc//sseennddmmaaiill..ccff).
  812.                     This is readable text -- it's not that tough.
  813.  
  814.  
  815.                //uussrr//lliibb//sseennddmmaaiill..ffcc
  816.                     --  a  frozen  version  of  the  configuration file.  A
  817.                     "quick"  image  that  needn't  be  parsed.  Unreadable.
  818.                     Rebuild when you change the config file by saying
  819.  
  820.                     [[99::4499aamm jjuulliiaann]] sseennddmmaaiill --bbzz
  821.  
  822.  
  823.                     Note: the daemon will still be using the old configura-
  824.                     tion file -- kill and restart it too.
  825.  
  826.  
  827.                //uussrr//lliibb//sseennddmmaaiill..hhff
  828.                     -- the help file (try the HELP command to the SMTP ser-
  829.                     vice).
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                UUWWOO//SSeennddmmaaiill                                              1122
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.                //uussrr//ssppooooll//mmqquueeuuee
  867.                     --  directory  of  spooled  messages  (this  is config-
  868.                     urable). Examine by saying
  869.  
  870.                     [[99::4499aamm jjuulliiaann]] mmaaiillqq
  871.                     [[99::4499aamm jjuulliiaann]] sseennddmmaaiill --bbpp
  872.  
  873.  
  874.                //uussrr//lliibb//aalliiaasseess
  875.                     -- a list of aliases for mail forwarding (this is  con-
  876.                     figurable). Readable.
  877.  
  878.  
  879.                //uussrr//lliibb//aalliiaasseess..{{ddiirr,,ppaagg}}
  880.                     -- data base versions of alias file.  Aliases are _l_o_c_a_l
  881.                     addresses. If you change the aliases file create a  new
  882.                     data base:
  883.  
  884.                     [[99::4499aamm jjuulliiaann]] nneewwaalliiaasseess
  885.                     [[99::4499aamm jjuulliiaann]] sseennddmmaaiill --bbii
  886.  
  887.  
  888.                //eettcc//ppaasssswwdd
  889.                     -- local users data base.
  890.  
  891.  
  892.                ~~uusseerr//..ffoorrwwaarrdd
  893.                     -- per user forwarding.
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                1133                                              UUWWOO//SSeennddmmaaiill
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.                33..11..  SSeennddmmaaiill AAuuddiitt TTrraaiill
  933.  
  934.  
  935.                Sendmail  is usually configured (by an Option) to send audit
  936.                records to ssyyssllooggdd((88)) (yet another process started  at  boot
  937.                time).
  938.  
  939.  
  940.                Syslogd  is  configured  by //eettcc//ssyysslloogg..ccoonnff.  Ours will log
  941.                lots of records for mail (anything at  the  debug  level  or
  942.                above):
  943.  
  944.                [[33::3344ppmm jjuulliiaann]] ggrreepp mmaaiill //eettcc//ssyysslloogg..ccoonnff
  945.                mmaaiill..ddeebbuugg            //uussrr//ssppooooll//ssyysslloogg//mmaaiill
  946.  
  947.  
  948.                Every  site  sending/receiving mail _s_h_o_u_l_d maintain a syslog
  949.                of mail transactions.
  950.  
  951.                [[33::3344ppmm jjuulliiaann]] ttaaiill //uussrr//ssppooooll//ssyysslloogg//mmaaiill
  952.                MMaarr 2233 1155::3344::2200 jjuulliiaann sseennddmmaaiill[[33446622]]:: AAAA0033446622::
  953.                     mmeessssaaggee--iidd==<<99220033223322002244..AAAA0022668800@@jjuulliiaann..uuwwoo..ccaa>>
  954.                MMaarr 2233 1155::3344::2200 jjuulliiaann sseennddmmaaiill[[33446622]]:: AAAA0033446622::
  955.                     ffrroomm==<<ooppeerraattiioonnss--oowwnneerr@@uuwwoovvaaxx..uuwwoo..ccaa>>,,
  956.                     ssiizzee==448888,, ccllaassss==00,, rreecceeiivveedd ffrroomm hhyyddrraa..uuwwoo..ccaa
  957.                MMaarr 2233 1155::3344::2211 jjuulliiaann sseennddmmaaiill[[33446644]]:: AAAA0033446622::
  958.                     ttoo==<<sshheeiillaa@@jjuulliiaann..uuwwoo..ccaa>>,, ddeellaayy==0000::0000::0011,,
  959.                     ssttaatt==SSeenntt
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                UUWWOO//SSeennddmmaaiill                                              1144
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.                44..  SSeennddmmaaiill PPaarraaddiiggmm
  999.  
  1000.  
  1001.                Sendmail receives messages, delivers  them,  all  under  the
  1002.                control of configuration files.
  1003.  
  1004.  
  1005.                44..11..  IInnppuutt ttoo sseennddmmaaiill
  1006.  
  1007.  
  1008.                There  are  really only two ways for messages to be given to
  1009.                sendmail.
  1010.  
  1011.  
  1012.                 (1)   from mmaaiill, mmhh, nneewwss, uuuuccpp, ccrroonn, etc. These  programs
  1013.                       fork/exec  sendmail  with  stdin a message and argv a
  1014.                       list of recipients and flags.
  1015.  
  1016.  
  1017.                 (2)   from other mail daemons as  an  SMTP  service.  These
  1018.                       programs  open  a network connection to the SMTP ser-
  1019.                       vice. The sendmail daemon fork/exec's a child to take
  1020.                       care of the connection.
  1021.  
  1022.  
  1023.                 (3)   from //uussrr//ssppooooll//mmqquueeuuee (from above). The ddff**, and ccff**
  1024.                       files define messages that need to be delivered  (_e_g_.
  1025.                       when a network connection is down files are spooled).
  1026.                       The sendmail daemon  fork/exec's  a  child  every  so
  1027.                       often to handle these (--qq1155mm).
  1028.  
  1029.  
  1030.                44..22..  CCoonnffiigguurraattiioonn ffiilleess
  1031.  
  1032.  
  1033.                There  are lots of configuration files that control how mes-
  1034.                sages are delivered.
  1035.  
  1036.  
  1037.                 (1)   //uussrr//lliibb//sseennddmmaaiill..{{ccff,,ffcc}} defines parsing and  deliv-
  1038.                       ery  rules  --  tables _h_o_w to munge addresses and get
  1039.                       rid of mail.
  1040.  
  1041.  
  1042.                 (2)   //uussrr//ssppooooll//mmqquueeuuee is where messages are spooled.  The
  1043.                       ddff**, and ccff** files are deferred messages.
  1044.  
  1045.  
  1046.                 (3)   //uussrr//lliibb//aalliiaasseess..{{ddiirr,,ppaagg}}    aliases    for    local
  1047.                       addresses. _e_g_.  mail  for  "postmaster"  is  sent  to
  1048.                       "colleen".
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                1155                                              UUWWOO//SSeennddmmaaiill
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.                 (4)   //eettcc//ppaasssswwdd defines local addresses.
  1065.  
  1066.  
  1067.                Note  that  aalliiaasseess override ppaasssswwdd entries -- on our system
  1068.                we make sure that all users are entered into the alias file.
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                UUWWOO//SSeennddmmaaiill                                              1166
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.                44..33..  MMeessssaaggee ddeelliivveerryy
  1131.  
  1132.  
  1133.                There  are  really  only two ways for sendmail to get rid of
  1134.                messages.
  1135.  
  1136.  
  1137.                 (1)   sendmail fork/exec/pipes messages  to  programs  like
  1138.                       uuuuxx (for UUCP) and bbiinnmmaaiill (for local delivery). Exit
  1139.                       status determines success or failure.
  1140.  
  1141.  
  1142.                 (2)   sendmail talks SMTP over a TCP/IP socket  to  another
  1143.                       mail daemon.
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.                1177                                              UUWWOO//SSeennddmmaaiill
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.                55..  SSeennddmmaaiill CCoonnffiigguurraattiioonn FFiillee
  1197.  
  1198.  
  1199.                //uussrr//lliibb//sseennddmmaaiill..ccff  is  a  configuration file. Plain text,
  1200.                readable, edittable.  The frozen version (..ffcc) is a compiled
  1201.                version  that  is  easy to load. A supported distribution is
  1202.                available by anonymous ftp:
  1203.  
  1204.  
  1205.                              jjuulliiaann..uuwwoo..ccaa::~~ffttpp//nniicc//sseennddmmaaiill
  1206.  
  1207.  
  1208.  
  1209.                There are a number of sections to consider. At  first  blush
  1210.                this looks frightening but it needn't be:
  1211.  
  1212.                ## ww ---- tthhee ddoommaaiinn nnaammee ooff tthhiiss mmaacchhiinnee
  1213.                ## ll ---- ffoorrmmaatt ooff tthhee UUnniixx ""FFrroomm aaddddrr ddaattee"" lliinnee
  1214.                ## nn ---- MMAAIILL--DDAAEEMMOONN''ss nnaammee
  1215.                ## oo ---- ooppeerraattoorrss ((ffoorr bbrreeaakkiinngg ssttrriinnggss iinnttoo ttookkeennss))
  1216.                ## qq ---- ddeeffaauulltt ffoorrmmaatt ffoorr sseennddeerr aaddddrreessss
  1217.                ##
  1218.                DDee$$jj SSeennddmmaaiill $$vv//$$$$RReevviissiioonn:: 11..22 $$$$ rreeaaddyy aatt $$bb
  1219.                DDjjlluucciillllee..pphhyyssiiccss..uuwwoo..ccaa
  1220.                DDwwlluucciillllee..pphhyyssiiccss..uuwwoo..ccaa
  1221.                DDllFFrroomm $$gg  $$dd
  1222.                DDnnMMAAIILL--DDAAEEMMOONN
  1223.                DDoo..%%@@!!::,,||
  1224.                ##DDoo..::%%@@!!^^==//;;
  1225.                DDqq$$??xx$$xx $$..<<$$gg>>
  1226.                ##DDqq$$gg$$??xx (($$xx))$$..
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                UUWWOO//SSeennddmmaaiill                                              1188
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.                55..11..  CCoommmmeennttss
  1263.  
  1264.  
  1265.                Any  line  beginning  with  a  `#' is a comment to aid read-
  1266.                ablity. Our version should be readable  --  there  certainly
  1267.                are lots of comments.
  1268.  
  1269.                ## OOppttiioonnss......
  1270.                ## AA<<ffiillee>> wwhheerree iiss aalliiaass ffiillee llooccaatteedd??
  1271.                ## aa<<ttiimmee>> wwaaiitt hhooww lloonngg ffoorr aalliiaasseess ttoo bbee rreebbuuiilltt??
  1272.                ## BB<<vvaalluuee>> ssuubbssttiittuuttee wwhhaatt ffoorr wwhhiittee ssppaaccee?? ((ddeeff.. ''..''))
  1273.                ## CC<<nnuummbbeerr>> cchheecckkppooiinntt aafftteerr tthhiiss mmaannyy rreecciippiieennttss
  1274.                ## cc       qquueeuuee ffoorr eexxppeennssiivvee mmaaiilleerrss
  1275.                ## dd<<mmooddee>> ddeelliivveerryy mmooddee --
  1276.                ##         ii::iinntteerraaccttiivvee,, bb::bbaacckkggrroouunndd,, qq::qquueeuuee
  1277.                ## DD       rreebbuuiilldd aalliiaass ddaattaa bbaassee iiff rreeqquuiirreedd
  1278.                ## ee<<hhooww>>  ddiissppoossee ooff eerrrroorrss --
  1279.                ##         pp::pprriinntt,, qq::ssttaattuuss aalloonnee,, mm::mmaaiill,,
  1280.                ##         ww::wwrriittee,, ee::mmaaiill aanndd eexxiitt cclleeaann
  1281.                ## FF<<nnuummbbeerr>> pprrootteeccttiioonn mmooddee ffoorr qquueeuueedd ffiilleess
  1282.                ## ff       ssaavvee UUnniixx ssttyyllee FFrroomm lliinneess
  1283.                ## gg<<nnuummbbeerr>> sseett ggiidd oonn mmaaiilleerrss ttoo nnuummbbeerr
  1284.                ## HH<<ffiillee>> llooccaattiioonn ooff hheellpp ffiillee
  1285.                ## ii       iiggnnoorree ddootttteedd lliinneess ((ttrreeaatt ddoottss aass tteexxtt))
  1286.                ## LL<<nnuummbbeerr>> aauuddiitt ttrraaiill llooggggiinngg ((00::nnoonnee,, 99::nniiccee))
  1287.                ## mm       sseenndd ttoo mmee ttoooo ((eevveenn iiff sseennddeerr ==== rreecciipp))
  1288.                ## oo       oolldd ssttyyllee ((uunniixx)) hheeaaddeerrss ssuuppppoorrtteedd
  1289.                ## PP<<nnaammee>> PPoossttmmaasstteerr''ss nnaammee.... CCcc:: NNaakkss ttoo hhiimm ttoooo
  1290.                ## QQ<<ddiirr>>  wwhheerree ddoo II qquueeuuee??
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.                1199                                              UUWWOO//SSeennddmmaaiill
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.                55..22..  OOppttiioonnss
  1329.  
  1330.  
  1331.                Any  line  beginning  with an `O' is an option. Most options
  1332.                can be set on the command  line  as  `--ooxx<<vvaalluuee>>'  (but  few
  1333.                are).  Some have numeric values, others letters, etc.
  1334.  
  1335.                ## uu<<nnuummbbeerr>> mmaaiilleerrss rruunn uunnddeerr tthhiiss uuiidd
  1336.                ## vv         vveerrbboossee mmooddee
  1337.                ## xx<<nnuummbbeerr>> llooaadd aavveerraaggee wwhhiicchh ffoorrcceess ""ddqq"" ((ddeeff.. 88))
  1338.                ## XX<<nnuummbbeerr>> hhooww mmaannyy SSMMTTPP sseerrvveerrss ((ddeeff.. 1122))
  1339.                ##
  1340.                OOAA//uussrr//llooccaall//lliibb//aalliiaasseess
  1341.                OOaa1100mm
  1342.                OODD
  1343.                OOddbb
  1344.                OOFF00664400
  1345.                OOgg11
  1346.                OOHH//uussrr//lliibb//sseennddmmaaiill..hhff
  1347.                OOLL99
  1348.                OOmm
  1349.                OOoo
  1350.                ##OOPPppoossttmmaasstteerr
  1351.                OOQQ//uussrr//ssppooooll//mmqquueeuuee
  1352.  
  1353.  
  1354.                Recall   that   we   said   sendmail   usually   spools   in
  1355.                //uussrr//ssppooooll//mmqquueeuuee -- the OOQQ option defines the spool area.
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.                UUWWOO//SSeennddmmaaiill                                              2200
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.                55..33..  SSttrriinnggss
  1395.  
  1396.  
  1397.                Any line beginning  with  a  `D'  is  a  string  definition.
  1398.                Strings  are  set to single letters and referred to with the
  1399.                $$jj notation.
  1400.  
  1401.                ## RReeqquuiirreedd mmaaccrrooss ((DDeeffiinneedd ssttrriinnggss))
  1402.                ## ee ---- tthhee SSMMTTPP sseerrvviiccee rreeaaddyy mmeessssaaggee
  1403.                ## jj ---- tthhee mmaaiill--ddoommaaiinn nnaammee ooff tthhiiss mmaacchhiinnee
  1404.                ## ww ---- tthhee ddoommaaiinn nnaammee ooff tthhiiss mmaacchhiinnee
  1405.                ## ll ---- ffoorrmmaatt ooff tthhee UUnniixx ""FFrroomm aaddddrr ddaattee"" lliinnee
  1406.                ## nn ---- MMAAIILL--DDAAEEMMOONN''ss nnaammee
  1407.                ## oo ---- ooppeerraattoorrss ((ffoorr bbrreeaakkiinngg ssttrriinnggss iinnttoo ttookkeennss))
  1408.                ## qq ---- ddeeffaauulltt ffoorrmmaatt ffoorr sseennddeerr aaddddrreessss
  1409.                ##
  1410.                DDee$$jj SSeennddmmaaiill $$vv//$$$$RReevviissiioonn:: 11..22 $$$$ rreeaaddyy aatt $$bb
  1411.                DDjjlluucciillllee..pphhyyssiiccss..uuwwoo..ccaa
  1412.                DDwwlluucciillllee..pphhyyssiiccss..uuwwoo..ccaa
  1413.                DDllFFrroomm $$gg  $$dd
  1414.                DDnnMMAAIILL--DDAAEEMMOONN
  1415.                DDoo..%%@@!!::,,||
  1416.                ##DDoo..::%%@@!!^^==//;;
  1417.                DDqq$$??xx$$xx $$..<<$$gg>>
  1418.                ##DDqq$$gg$$??xx (($$xx))$$..
  1419.  
  1420.                Note, there are lots of reserved strings -- $$aa is  the  ARPA
  1421.                style date. Don't try to define these.
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                2211                                              UUWWOO//SSeennddmmaaiill
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.                55..44..  CCllaasssseess
  1461.  
  1462.  
  1463.                Any  line  beginning with a "C" is a class definition (a set
  1464.                of tokens).
  1465.  
  1466.                ## HHaacckknneeyyeedd ddoommaaiinnss II rreeaacchh tthhrruu aa llooccaall rreellaayy hhoosstt
  1467.                CCRRbbiittnneett ccddnn uuuuccpp
  1468.                ## mmaajjoorr rreellaayy hhoosstt
  1469.                DDRRmmaaiill--rreellaayy..uuwwoo..ccaa
  1470.  
  1471.                Classes are set to single letters and referenced by the  $$==YY
  1472.                notation.  The  only  class  we use is for the set of pseudo
  1473.                domains not supported in the DNS. We get  mail  to  them  by
  1474.                punting to mmaaiill--rreellaayy..uuwwoo..ccaa.
  1475.  
  1476.                Note  distinction  between  $$RR  (the  string)  and  $$==RR (the
  1477.                class). In the example we define a class of pseudo domains
  1478.  
  1479.                CCRRbbiittnneett ccddnn uuuuccpp
  1480.  
  1481.                and a string for the name of a gateway machine
  1482.  
  1483.                DDRRmmaaiill--rreellaayy..uuwwoo..ccaa
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.                UUWWOO//SSeennddmmaaiill                                              2222
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.                55..55..  HHeeaaddeerrss
  1527.  
  1528.  
  1529.                Any line beginning with a "H"  is  a  header  definition  --
  1530.                these are usually fine.
  1531.  
  1532.                ##########################################################
  1533.                ## FFoorrmmaatt ooff hheeaaddeerrss
  1534.                ##
  1535.                HH??RR??RReecceeiivveedd:: $$??ssffrroomm $$ss $$..bbyy $$jj$$??rr wwiitthh $$rr$$..;;
  1536.                        ((iidd $$ii)) $$bb
  1537.                HH??MM??RReesseenntt--MMeessssaaggee--IIdd:: <<$$tt..$$ii@@$$jj>>
  1538.                HH??MM??MMeessssaaggee--IIdd:: <<$$tt..$$ii@@$$jj>>
  1539.                HH??DD??RReesseenntt--DDaattee:: $$aa
  1540.                HH??DD??DDaattee:: $$aa
  1541.                HH??FF??RReesseenntt--FFrroomm:: $$qq
  1542.                HH??FF??FFrroomm:: $$qq
  1543.                HH??xx??FFuullll--NNaammee:: $$xx
  1544.                HHSSuubbjjeecctt::
  1545.                ## HHPPoosstteedd--DDaattee:: $$aa
  1546.                ## HH??ll??RReecceeiivveedd--DDaattee:: $$bb
  1547.  
  1548.                There's an interesting conditional construction:
  1549.  
  1550.                $$??ssffrroomm $$ss $$..
  1551.  
  1552.                This  means:  if  the  string `ss' is defined then substitute
  1553.                `ffrroomm $$ss'.
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.                2233                                              UUWWOO//SSeennddmmaaiill
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.                55..66..  MMaaiilleerr
  1593.  
  1594.  
  1595.                Any line beginning with a "M" is a mailer  definition.  This
  1596.                defines  how sendmail should communicate with different pro-
  1597.                grams, _e_g_. does the program accept  multiple  recipients  on
  1598.                the same line?
  1599.  
  1600.                ##
  1601.                ## MMaaiilleerr ssppeecciiffiiccaattiioonnss......
  1602.                ##
  1603.                MMllooccaall,, PP==//uussrr//llooccaall//lliibb//bbiinnmmaaiill,,
  1604.                        FF==rrllssXXRRDDFFMMmmnnPP,, AA==mmaaiill --dd $$uu
  1605.                MMpprroogg,,  PP==//bbiinn//sshh,,   FF==llssDDFFMMeeuuPP,,
  1606.                        AA==sshh --cc $$uu
  1607.                MMeetthheerr,, PP==[[IIPPCC]],, FF==mmssDDFFMMuuCCXX,,
  1608.                        AA==IIPPCC $$hh,, EE==\\rr\\nn
  1609.  
  1610.  
  1611.                The  IIPPCC  mailer (ie. SMTP over TCP/IP) is built in -- send-
  1612.                mail takes care of the Inter  Process  Communcation  without
  1613.                the aid of any delivery program.
  1614.  
  1615.  
  1616.                Sendmail  uses  a program to deliver mail locally -- that is
  1617.                not built in.
  1618.  
  1619.  
  1620.                We, optionally, support a mailer for  routing  over  a  UUCP
  1621.                link.
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.                UUWWOO//SSeennddmmaaiill                                              2244
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.                55..77..  RRuulleess aanndd RRuullee SSeettss
  1659.  
  1660.  
  1661.                Any  line beginning with an "S" defines a numbered rule set.
  1662.                _e_g_. S0 the message delivery rule set  and  S3  the  preamble
  1663.                rule set.
  1664.  
  1665.                ########################################################################################################
  1666.                ## RRee--wwrriittiinngg rruulleess aarree ttrriivviiaall,, II eeiitthheerr kknnooww aabboouutt
  1667.                ## tthhee MMXX wwoorrlldd oorr,, aalltteerrnnaattiivveellyy,, kknnooww ooff ssoommeeoonnee wwhhoo
  1668.                ## ddooeess.. TTwwoo rroouutteess aarree ssuuppppoorrtteedd ttoo tthhee ssmmaarrtt gguuyy ----
  1669.                ## ssmmttpp//iipp oorr uuuuxx//uuuuccpp..
  1670.                ##
  1671.                SS00
  1672.                RR||$$**@@$$jj       $$##pprroogg$$::$$11             llooccaall ppiippee
  1673.                RR$$**@@$$jj        $$##llooccaall$$::$$11            llooccaall ppeerrssoonn
  1674.                RR$$**@@$$**..$$==RR    $$##eetthheerr$$@@$$RR$$::$$11@@$$22..$$33  ttoo ggaatteewwaayy
  1675.                RR$$**@@$$**        $$##eetthheerr$$@@$$22$$::$$11@@$$22     vviiaa mmxx mmeetthhoodd
  1676.  
  1677.  
  1678.  
  1679.                Certain  rule  sets are reserved (_e_g_. _a_l_l _o_f  S0, S1, S2, S3
  1680.                and S4 have special roles).
  1681.  
  1682.  
  1683.                Some are required, _e_g_. S0 is required (for obvious reasons).
  1684.                All else can be empty.
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.                2255                                              UUWWOO//SSeennddmmaaiill
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.                55..88..  RRuulleess
  1725.  
  1726.  
  1727.                Any  line  beginning with an "R" is a rewriting rule. A rule
  1728.                on how to munge an address. All rules look like
  1729.  
  1730.  
  1731.                           R_p_a_t_t_e_r_n<tab>_r_e_w_r_i_t_e_-_r_u_l_e<tab>_c_o_m_m_e_n_t
  1732.  
  1733.  
  1734.                For example, the preamble rule set:
  1735.  
  1736.                SS33
  1737.                RRllooccaall!!$$**     $$::$$11        ttoo mmaakkee rrmmaaiill wwoorrkk
  1738.                RR<<>>           $$@@$$nn@@$$jj     ttuurrnn iinnttoo mmaaggiicc ttookkeenn
  1739.                RR$$**<<$$++>>$$**     $$22          bbaassiicc RRFFCC882211//882222 ppaarrssiinngg
  1740.                RR@@$$**::$$**       $$::$$22        aarroouunndd hheerree ((rreeqq))
  1741.                RR$$-- aatt $$--     $$11@@$$22       oolldd ffaasshhiioonneedd,, aanndd dduummbb
  1742.                RR$$**@@$$--        $$@@$$11@@$$22..$$UU  qquuaalliiffyy
  1743.                RR$$**@@$$ww        $$@@$$11@@$$jj     uussee pprreeffffeerreedd ddoommaaiinn
  1744.                RR$$**@@$$**        $$@@$$11@@$$22     llooookkss ffiinnee
  1745.                RR$$**           $$@@$$11@@$$jj
  1746.  
  1747.  
  1748.                In our sendmail configuration the function of S3 is to  turn
  1749.                all addresses into strings that look like `uusseerr@@ddoo..mmaa..iinn'.
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.                UUWWOO//SSeennddmmaaiill                                              2266
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.                55..88..11..  RRuullee SSeett FFllooww
  1791.  
  1792.  
  1793.                All  addresses  are  munged by a sequence of `Rewriting Rule
  1794.                Sets'. The diagram shows the various sequences. For example,
  1795.                a  _r_e_s_o_l_v_e_d _a_d_d_r_e_s_s is an address that has been munged by S3
  1796.                then by S0.
  1797.  
  1798.                                -->> SS00 -->> aa ``rreessoollvveedd aaddddrreessss''
  1799.                               //
  1800.                              //      -->> SS11 -->> SS -->>
  1801.                             //      //             \\
  1802.                aaddddrreessss -->> SS33 -->> DD --               -->> SS44 -->> mmeessssaaggee
  1803.                                    \\             //
  1804.                                     -->> SS22 -->> RR -->>
  1805.  
  1806.  
  1807.                All addresses are munged through S3, then follow the  arrows
  1808.                as appropriate.
  1809.  
  1810.  
  1811.                The  paths are for envelope addresses (S3 to S0) and message
  1812.                header addresses (S3, D, S1, S, and S4 for Sender  addresses
  1813.                vs S3, D, S2, R, and S4 for Recipient addresses).
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.                2277                                              UUWWOO//SSeennddmmaaiill
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.                 (1)   Recipient  addresses then go through S3 then S0 where
  1857.                       they're `resolved' to  a  delivery  program  and  arg
  1858.                       list; ie. $$##MMaaiilleerr$$@@......$$::......
  1859.  
  1860.  
  1861.                 (2)   Rule D is implicit (ie. no written set here) and con-
  1862.                       fusing -- if delivery to  the  sender  is  through  a
  1863.                       mailer  with  a C flag then any unqualified addresses
  1864.                       get his domain.
  1865.  
  1866.  
  1867.                 (3)   All Sender addresses go through S1, a mailer specific
  1868.                       rule  set `S' (see mailer line), through S4, and into
  1869.                       the message header.
  1870.  
  1871.  
  1872.                 (4)   All Recipient addresses go through S2, a mailer  spe-
  1873.                       cific rule set `R' (see mailer line), through S4, and
  1874.                       into the message header.
  1875.  
  1876.  
  1877.                Rule set D  is useful since  many sites don't  full  qualify
  1878.                their mail   -- ie.  by  `uusseerr' they  mean `@@mmyy--ddoommaaiinn'  and
  1879.                not `@@yyoouurr--ddoommaaiinn'.
  1880.  
  1881.  
  1882.                Rule sets  S  and   R are   useful  when    you  communicate
  1883.                with   non-compliant sites -- like dumb old UUCP.
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.                UUWWOO//SSeennddmmaaiill                                              2288
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.                55..88..22..  RRuullee SSeemmaannttiiccss
  1923.  
  1924.  
  1925.                While  the  input string matches the left hand pattern apply
  1926.                the right hand rewrite rule. Else procede to  next  rule  in
  1927.                the set.
  1928.  
  1929.                RR$$** aatt $$--   $$11@@$$22..BBIITTNNEETT   yyeecchh,, pprrooffss
  1930.  
  1931.  
  1932.                In the sendmail.cf we support you'll find:
  1933.  
  1934.  
  1935.                 (1)   S1, S2, S4 are empty -- the important work is done in
  1936.                       S0 and S3.
  1937.  
  1938.  
  1939.                 (2)   S3 turns all addresses into uusseerr@@ddoo..mmaa..iinn (note  that
  1940.                       the < and > are dropped).
  1941.  
  1942.  
  1943.                 (3)   S0,  given  input  as uusseerr@@ddoo..mmaa..iinn, decides delivery
  1944.                       mechanism by pattern matching on  "ddoo..mmaa..iinn".  Is  it
  1945.                       local?  Is it a pseudo-domain (like UUCP and BITNET)?
  1946.                       Is it an MX domain?
  1947.  
  1948.  
  1949.                 (4)   Rules sets for recipient S5 and sender  S6  rewriting
  1950.                       are  defined  as  mailer  specific  rules -- the only
  1951.                       given one is for UUCP.
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.                2299                                              UUWWOO//SSeennddmmaaiill
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.                55..88..33..  PPaatttteerrnn SSeemmaannttiiccss
  1989.  
  1990.  
  1991.                Strings are broken in  "tokens"  according  to  the  special
  1992.                characters of "$$oo".
  1993.  
  1994.                DDoo..%%@@!!::
  1995.  
  1996.  
  1997.                For example, the address
  1998.  
  1999.  
  2000.                             aa336622%%uuwwoocccc11..bbiittnneett@@ccuunnyyvvmm..ccuunnyy..eedduu
  2001.  
  2002.  
  2003.  
  2004.                will  be broken into a sequence of tokens for pattern match-
  2005.                ing and rewriting.
  2006.  
  2007.  
  2008.                The tokens in this example are: `aa336622' (a  string),  `%%'  (a
  2009.                single  character),  `uuwwoocccc11', `..', `bbiittnneett', `@@', `ccuunnyyvvmm',
  2010.                `..', `ccuunnyy', `..', and finally `eedduu'.
  2011.  
  2012.  
  2013.                Some tokens are  single  characters,  others  are  character
  2014.                strings.
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.                UUWWOO//SSeennddmmaaiill                                              3300
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.                In the pattern matching the meta notations are:
  2055.  
  2056.  
  2057.                 (1)   $$** matches any sequence of tokens
  2058.  
  2059.                       RRllooccaall!!$$**       $$::$$11
  2060.  
  2061.                       _e_g_. local!julian.uwo.ca!reggers
  2062.  
  2063.  
  2064.                 (2)   $$++ matches any non-trivial sequence of tokens
  2065.  
  2066.                       RR$$**<<$$++>>$$**       $$::$$22
  2067.  
  2068.                       _e_g_. Reg Quinton <reggers@uwovax.uwo.ca>
  2069.  
  2070.  
  2071.                 (3)   $$-- matches any single token.
  2072.  
  2073.                       RR$$**@@$$--          $$::$$11@@$$22..$$UU
  2074.  
  2075.                       _e_g_. reggers@uwovax
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.                3311                                              UUWWOO//SSeennddmmaaiill
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.                 (4)   $$xx matches the ssttrriinngg defined by `DDxx''
  2121.  
  2122.                       RR$$**@@$$jj          $$##llooccaall$$::$$11
  2123.  
  2124.                       _e_g_. rreeggggeerrss@@jjuulliiaann..uuwwoo..ccaa
  2125.  
  2126.  
  2127.                 (5)   $$==xx matches a ttookkeenn in the class defined by `CCxx''
  2128.  
  2129.                       RR$$**@@$$**..$$==RR      $$##eetthheerr$$@@$$RR$$::$$11@@$$22..$$33
  2130.  
  2131.                       _e_g_. aa336622@@uuwwoocccc11..BBIITTNNEETT
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.                UUWWOO//SSeennddmmaaiill                                              3322
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.                55..88..44..  RReewwrriittiinngg SSeemmaannttiiccss
  2187.  
  2188.  
  2189.                A  rewriting  rule is only applied if the string matches the
  2190.                pattern. The rule is applied until it fails, then on to  the
  2191.                next  in  the rule set.  In the rewriting the meta notations
  2192.                are:
  2193.  
  2194.  
  2195.                 (1)   $nn is _n_t_h patten match in the string (count only  the
  2196.                       $ matches).
  2197.  
  2198.                       RR@@$$**::$$**         $$::$$22
  2199.  
  2200.  
  2201.                 (2)   $$::rruullee...  apply  the rule and procede to the next in
  2202.                       rule set.
  2203.  
  2204.                       RR<<>>             $$::$$nn
  2205.  
  2206.  
  2207.                 (3)   $$@@rruullee... apply the rule and exit the rule set.
  2208.  
  2209.                       RR$$--             $$@@$$11@@$$jj
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.                3333                                              UUWWOO//SSeennddmmaaiill
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.                 (4)   $$##mmaaiilleerr... deliver to mailer (only in S0!)
  2253.  
  2254.                       RR$$--             $$##llooccaall$$::$$11
  2255.  
  2256.  
  2257.                Within a ##MMaaiilleerr rule $$:: names the user, $$@@ names the  host.
  2258.                For example
  2259.  
  2260.                RR$$**@@$$**..$$==RR      $$##eetthheerr$$@@$$RR$$::$$11@@$$22..$$33
  2261.  
  2262.  
  2263.                The  mailer is eetthheerr, the host $$RR, and the user is $$11@@$$22..$$33.
  2264.                This punts pseudo domains to a gateway machine.
  2265.  
  2266.                RR$$**@@$$**          $$##eetthheerr$$@@$$22$$::$$11@@$$22
  2267.  
  2268.  
  2269.                Again, the mailer is eetthheerr, but the host $$22, and the user is
  2270.                $$11@@$$22.  This sends real domains to the machine listed in the
  2271.                MX record.
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.                UUWWOO//SSeennddmmaaiill                                              3344
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.                66..  SSeennddmmaaiill TTeessttiinngg
  2319.  
  2320.  
  2321.                You can test whether an address is deliverable or how a list
  2322.                expands:
  2323.  
  2324.                [[1100::4433aamm jjuulliiaann]] sseennddmmaaiill --bbvv rreeggggeerrss@@uuwwoovvaaxx..uuwwoo..ccaa
  2325.                rreeggggeerrss@@uuwwoovvaaxx..uuwwoo..ccaa...... ddeelliivveerraabbllee
  2326.  
  2327.  
  2328.                You can test rule sets in a verbose mode:
  2329.  
  2330.                [[1100::4433aamm jjuulliiaann]] sseennddmmaaiill --bbtt
  2331.                AADDDDRREESSSS TTEESSTT MMOODDEE
  2332.                EEnntteerr <<rruulleesseett>> <<aaddddrreessss>>
  2333.                >> 00 rreeggggeerrss@@uuwwoovvaaxx..uuwwoo..ccaa
  2334.                rreewwrriittee:: rruulleesseett  33   iinnppuutt::
  2335.                     ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2336.                rreewwrriittee:: rruulleesseett  33 rreettuurrnnss::
  2337.                     ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2338.                rreewwrriittee:: rruulleesseett  00   iinnppuutt::
  2339.                     ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2340.                rreewwrriittee:: rruulleesseett  00 rreettuurrnnss::
  2341.                     ""^^VV"" ""eetthheerr"" ""^^WW"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2342.                     ""^^XX"" ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2343.  
  2344.  
  2345.                Note that Rule Set 3 is always applied.  Note also the token
  2346.                sequences displayed as input and output to th the rule sets.
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.                3355                                              UUWWOO//SSeennddmmaaiill
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.                You can test a new configuration file:
  2385.  
  2386.                [[1100::4433aamm jjuulliiaann]] sseennddmmaaiill --bbtt --CCsseennddmmaaiill..ccff
  2387.                AADDDDRREESSSS TTEESSTT MMOODDEE
  2388.                EEnntteerr <<rruulleesseett>> <<aaddddrreessss>>
  2389.                >> 00 rreeggggeerrss@@uuwwoovvaaxx..uuwwoo..ccaa
  2390.  
  2391.  
  2392.                Make  sure  you test things before you install them. Testing
  2393.                with rule set 0 is most common.
  2394.  
  2395.                [[1100::4433aamm jjuulliiaann]] sseennddmmaaiill --bbtt
  2396.                AADDDDRREESSSS TTEESSTT MMOODDEE
  2397.                EEnntteerr <<rruulleesseett>> <<aaddddrreessss>>
  2398.                >> 00 rreeggggeerrss@@uuwwoovvaaxx..uuwwoo..ccaa
  2399.                rreewwrriittee:: rruulleesseett  33   iinnppuutt::
  2400.                     ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2401.                rreewwrriittee:: rruulleesseett  33 rreettuurrnnss::
  2402.                     ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2403.                rreewwrriittee:: rruulleesseett  00   iinnppuutt::
  2404.                     ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2405.                rreewwrriittee:: rruulleesseett  00 rreettuurrnnss::
  2406.                     ""^^VV"" ""eetthheerr"" ""^^WW"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2407.                     ""^^XX"" ""rreeggggeerrss"" ""@@"" ""uuwwoovvaaxx"" "".."" ""uuwwoo"" "".."" ""ccaa""
  2408.  
  2409.                The mailer is specified with ^V, the host with ^W, the  user
  2410.                with ^X.  Each as a sequence of tokens.
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.                UUWWOO//SSeennddmmaaiill                                              3366
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.                77..  AAddddrreessss RReewwrriittiinngg
  2451.  
  2452.                We're  trying  to  turn  all  addresses  into user@do.ma.in.
  2453.                Here's what you have to deal with:
  2454.  
  2455.  
  2456.                uusseerr Easy, tack on local domain ($$jj).
  2457.  
  2458.  
  2459.                uusseerr@@ddoo..mmaa..iinn
  2460.                     Easy, assume correct.
  2461.  
  2462.  
  2463.                <<@@ssiittee,,@@ssiittee::uusseerr@@ddoommaaiinn>>
  2464.                     Easy, use the last part. But some sites  don't  qualify
  2465.                     the  trailing domain (that's their problem).  This pre-
  2466.                     dates the Domain Name System and shouldn't be used any-
  2467.                     more.
  2468.  
  2469.  
  2470.                hhoosstt!!hhoosstt!!uusseerr
  2471.                     Easy,  write as uusseerr@@hhoosstt..UUUUCCPP (but requires that some-
  2472.                     one  support  UUCP  maps).  Should   only   appear   on
  2473.                     julian.uwo.ca (and on uucp neighbors).
  2474.  
  2475.  
  2476.                hhoosstt!!ddoo..mmaa..iinn!!uusseerr
  2477.                     Easy, write as uusseerr@@ddoo..mmaa..iinn
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.                3377                                              UUWWOO//SSeennddmmaaiill
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.                uusseerr@@hhoosstt
  2517.                     This is hard -- should we assume local domain, or UUCP,
  2518.                     or BITNET, or what?  No matter what you chose, you will
  2519.                     be wrong in ssoommee instances. We assume local domain.
  2520.  
  2521.  
  2522.                This  explains  why  one  occasionally sees addresses of the
  2523.                form uusseerr@@hhoosstt..uuwwoo..ccaa when  the  host  isn't  in  the  local
  2524.                domain
  2525.  
  2526.  
  2527.                If  everyone  behaved,  ie.  used fully qualified registered
  2528.                domain names, we would have no problems.
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.                UUWWOO//SSeennddmmaaiill                                              3388
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.                88..  MMXX sseennddmmaaiill
  2583.  
  2584.  
  2585.                A domain is listed  in  the  Domain  Name  Service.  Records
  2586.                detail  things  like AA (address), WWKKSS (well known services),
  2587.                HHIINNFFOO (machine type), MMXX (mail exchangeer), and  other  good
  2588.                stuff  (the  IINN  records  are  Internet  information,  other
  2589.                records are possbile -- like Decnet, IPX, etc.).
  2590.  
  2591.  
  2592.                From the cogsci DNS data:
  2593.  
  2594.                ccooggssccii..uuwwoo..ccaa..  IINN AA 112299..110000..66..1100
  2595.                     IINN MMXX 00    ccooggssccii..uuwwoo..ccaa..
  2596.                     IINN MMXX 1100   jjuulliiaann..uuwwoo..ccaa..
  2597.                     IINN HHIINNFFOO   SSuunn33//116600 ""SSuunn UUNNIIXX""
  2598.  
  2599.  
  2600.                The MX records order the hosts that should be  tried  --  if
  2601.                you  have  mail  for  uusseerr@@ccooggssccii..uuwwoo..ccaa  try  to connect to
  2602.                ccooggssccii..uuwwoo..ccaa, if that fails try jjuulliiaann..uuwwoo..ccaa, and if  that
  2603.                fails spool and try again later.
  2604.  
  2605.  
  2606.                Note  that  mail  for cogsci.uwo.ca is delivered ddiirreeccttllyy to
  2607.                them.  It is nnoott store and  forward  through  some  gateway.
  2608.                Very different from the old days of BITNET, UUCP, MLNET, and
  2609.                other store and forward nets.
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.                3399                                              UUWWOO//SSeennddmmaaiill
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.                Alternatively ...
  2649.  
  2650.                [[1111::2266aamm jjuulliiaann]] nnssllooookkuupp
  2651.                DDeeffaauulltt SSeerrvveerr::  jjuulliiaann..uuwwoo..ccaa
  2652.                AAddddrreessss::  112299..110000..22..1122
  2653.  
  2654.                >> sseett ttyyppee==aannyy
  2655.                >> llrrii..uuwwoo..ccaa
  2656.                SSeerrvveerr::  jjuulliiaann..uuwwoo..ccaa
  2657.                AAddddrreessss::  112299..110000..22..1122
  2658.  
  2659.                llrrii..uuwwoo..ccaa      pprreeffeerreennccee == 00,,
  2660.                     mmaaiill eexxcchhaannggeerr == jjuulliiaann..uuwwoo..ccaa
  2661.                llrrii..uuwwoo..ccaa      pprreeffeerreennccee == 1100,,
  2662.                     mmaaiill eexxcchhaannggeerr == hhyyddrraa..uuwwoo..ccaa
  2663.                llrrii..uuwwoo..ccaa      CCPPUU==SSGGII OOSS==UUnniixx
  2664.                jjuulliiaann..uuwwoo..ccaa   iinneett aaddddrreessss == 112299..110000..22..1122
  2665.                hhyyddrraa..uuwwoo..ccaa    iinneett aaddddrreessss == 112299..110000..22..1133
  2666.                >>
  2667.  
  2668.  
  2669.                Not all domains listed in the DNS have an  IP  address  (_e_g_.
  2670.                **..ddeecc..ccoomm). If a domain is addressable by E-mail they either
  2671.                have an IP address or a MX record pointing  at  someone  who
  2672.                does.
  2673.  
  2674.  
  2675.                You  can  mail to sites not on the Internet -- by mailing to
  2676.                MX gateways which can forward things on.
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.                UUWWOO//SSeennddmmaaiill                                              4400
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.                Note that ssoommee mail addresses mention systems that  are  not
  2715.                listed in the DNS
  2716.  
  2717.                [[1111::2288aamm jjuulliiaann]] nnssllooookkuupp
  2718.                DDeeffaauulltt SSeerrvveerr::  jjuulliiaann..uuwwoo..ccaa
  2719.                AAddddrreessss::  112299..110000..22..1122
  2720.  
  2721.                >> sseett ttyyppee==aannyy
  2722.                >> uuwwoocccc11..bbiittnneett
  2723.                SSeerrvveerr::  jjuulliiaann..uuwwoo..ccaa
  2724.                AAddddrreessss::  112299..110000..22..1122
  2725.                ****** jjuulliiaann..uuwwoo..ccaa
  2726.                    ccaann''tt ffiinndd uuwwoocccc11..bbiittnneett:: NNoonn--eexxiisstteenntt ddoommaaiinn
  2727.  
  2728.                >> wwaattmmaatthh..uuuuccpp
  2729.                SSeerrvveerr::  jjuulliiaann..uuwwoo..ccaa
  2730.                AAddddrreessss::  112299..110000..22..1122
  2731.                ****** jjuulliiaann..uuwwoo..ccaa
  2732.                    ccaann''tt ffiinndd wwaattmmaatthh..uuuuccpp:: NNoonn--eexxiisstteenntt ddoommaaiinn
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.                4411                                              UUWWOO//SSeennddmmaaiill
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.                Strictly  speaking,  pseudo-domains  (like  bitnet and uucp)
  2781.                should be hidden behind some real domain.
  2782.  
  2783.                rreeggggeerrss%%uuwwoocccc11..bbiittnneett@@hhyyddrraa..uuwwoo..ccaa
  2784.  
  2785.  
  2786.                But we support _s_o_m_e with a rule
  2787.  
  2788.                CCRRbbiittnneett uuuuccpp ccddnn
  2789.                 _e_t_c _._._._._.
  2790.                RR$$**@@$$**..$$==RR      $$##eetthheerr$$@@$$RR$$::$$11@@$$22..$$33
  2791.  
  2792.  
  2793.                You can mail to uusseerr@@hhoosstt..bbiittnneett because your sendmail  sys-
  2794.                tem  has  been  configured  to route that pseudo domain to a
  2795.                gateway machine.
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.                UUWWOO//SSeennddmmaaiill                                              4422
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.                88..11..  MMXX rroouuttiinngg
  2847.  
  2848.  
  2849.                Consider the rule in S0:
  2850.  
  2851.                RR$$**@@$$**          $$##eetthheerr$$@@$$RR$$::$$11@@$$22
  2852.  
  2853.  
  2854.                This punts, via SMTP, everything to a gateway (usually mmaaiill--
  2855.                rreellaayy..uuwwoo..ccaa).  This requires that the gateway understand MX
  2856.                routing (or punt on to some who does).
  2857.  
  2858.  
  2859.                This also requires a cooperating gateway  to  do  your  work
  2860.                (recall our goal is to make you self sufficient).
  2861.  
  2862.  
  2863.                RR$$**@@$$**          $$##eetthheerr$$@@$$22$$::$$11@@$$22
  2864.  
  2865.  
  2866.                This  punts,  via  SMTP, to the recipient domain. For non-MX
  2867.                sendmails this would  require  that  you  list  all  250,000
  2868.                domains  in  //eettcc//hhoossttss.  For MX sendmail the DNS is queried
  2869.                and MX records are honored.
  2870.  
  2871.  
  2872.                An MX version of sendmail makes rule set  S0  simple  --  an
  2873.                address  is  either  local,  a pseudo-domain, or else a real
  2874.                domain.
  2875.  
  2876.  
  2877.                Fortunately the number of pseudo domains has decreased  over
  2878.                the years.
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.                4433                                              UUWWOO//SSeennddmmaaiill
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.                99..  RRsseennddmmaaiill ---- NNFFSS eennvviirroonnmmeenntt
  2913.  
  2914.  
  2915.                The  typical  NFS  environment  around  Western  is a hidden
  2916.                domain with shared:
  2917.  
  2918.  
  2919.                 (1)   //eettcc//ppaasssswwdd
  2920.  
  2921.                 (2)   //uussrr//ssppooooll//mmaaiill
  2922.  
  2923.  
  2924.                Having configured sendmail on  the  server  machine  how  do
  2925.                users submit mail?  Two alternatives:
  2926.  
  2927.  
  2928.                 (1)   Configure  a simple sendmail.cf for your clients that
  2929.                       punts to the server.
  2930.  
  2931.                 (2)   Construct a simple sendmail  for  your  clients  that
  2932.                       rsh's sendmail on the server.
  2933.  
  2934.                       jjuulliiaann..uuwwoo..ccaa::~~ffttpp//nniicc//rrsseennddmmaaiill
  2935.  
  2936.  
  2937.                This  has  some  minor problems, but is in use at many sites
  2938.                (especially within CCS).
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.                UUWWOO//SSeennddmmaaiill                                              4444
  2968.  
  2969.  
  2970.  
  2971.